/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import com.google.common.collect.Sets;
/*     */ import io.netty.util.internal.ThreadLocalRandom;
/*     */ import java.net.MalformedURLException;
/*     */ import java.net.URI;
/*     */ import java.net.URISyntaxException;
/*     */ import java.net.URL;
/*     */ import java.net.URLStreamHandler;
/*     */ import java.util.Locale;
/*     */ import java.util.Random;
/*     */ import java.util.Set;
/*     */ import java.util.UUID;
/*     */ import java.util.concurrent.ExecutorService;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.audio.ISound;
/*     */ import net.minecraft.client.audio.ISoundEventAccessor;
/*     */ import net.minecraft.client.audio.Sound;
/*     */ import net.minecraft.client.audio.SoundEventAccessor;
/*     */ import net.minecraft.client.audio.SoundHandler;
/*     */ import net.minecraft.client.audio.SoundManager;
/*     */ import net.minecraft.util.ResourceLocation;
/*     */ import net.minecraft.util.SoundCategory;
/*     */ import net.minecraft.util.SoundEvent;
/*     */ import net.minecraft.util.math.MathHelper;
/*     */ import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
/*     */ import net.minecraftforge.fml.relauncher.ReflectionHelper;
/*     */ import paulscode.sound.SoundSystem;
/*     */ 
/*     */ 
/*     */ 
/*     */ @EventBusSubscriber(modid = "dragoncore")
/*     */ public class de
/*     */ {
/*  35 */   public static final ExecutorService q = zg.g;
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"取值类型", "Type_Get"})
/*     */   public static String v(o a) {
/*  40 */     return a.v();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"值类型是否相同", "Type_Equal"})
/*     */   public static boolean v(o a, String str) {
/*  45 */     String str1 = a.v();
/*  46 */     if (str1.equals("string") && str.equals("double")) {
/*  47 */       String str2 = a.z();
/*  48 */       if (str2.equals("true") || str2.equals("false")) {
/*  49 */         str1 = "double";
/*     */       } else {
/*     */         try {
/*  52 */           Double.parseDouble(str2);
/*  53 */           str1 = "double";
/*  54 */         } catch (NumberFormatException numberFormatException) {}
/*     */       } 
/*     */     } 
/*     */ 
/*     */     
/*  59 */     return str1.equals(str);
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"播放声音", "声音", "播放音乐", "Sound_Play"})
/*     */   public static String v(vh a, String str, float f1, float f2, float f3, float f4, float f5, boolean bool) {
/*  64 */     return v(a, MathHelper.func_180182_a((Random)ThreadLocalRandom.current()).toString(), str, SoundCategory.MASTER, f1, f2, f3, f4, f5, bool);
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"播放声音1", "声音1", "播放音乐1", "Sound_Play1"})
/*     */   public static String v(vh a, String str1, String str2, float f1, float f2, float f3, float f4, float f5, boolean bool) {
/*  69 */     return v(a, str1, str2, SoundCategory.MASTER, f1, f2, f3, f4, f5, bool);
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"播放声音2", "声音2", "播放音乐2", "Sound_Play2"})
/*     */   public static String v(vh a, String str1, String str2, String str3, float f1, float f2, float f3, float f4, float f5, boolean bool) {
/*  74 */     SoundCategory soundCategory = SoundCategory.func_187950_a(str3);
/*  75 */     return v(a, str1, str2, soundCategory, f1, f2, f3, f4, f5, bool);
/*     */   }
/*     */   
/*     */   public static String v(vh a, String str1, String str2, SoundCategory soundCategory, float f1, float f2, float f3, float f4, float f5, boolean bool) {
/*  79 */     if (soundCategory == null) {
/*  80 */       soundCategory = SoundCategory.MASTER;
/*     */     }
/*  82 */     str2 = str2.isEmpty() ? "ui.button.click" : str2;
/*  83 */     f1 = (f1 == 0.0F) ? 1.0F : f1;
/*  84 */     f2 = (f2 == 0.0F) ? 1.0F : f2;
/*     */     
/*  86 */     if (str2.endsWith(".ogg")) {
/*  87 */       v(str1, str2, soundCategory, f1, f2, f3, f4, f5, bool);
/*  88 */       if (a != null) {
/*  89 */         a.h.add(str1);
/*     */       }
/*  91 */       return str1;
/*     */     } 
/*  93 */     SoundEvent soundEvent = (SoundEvent)SoundEvent.field_187505_a.func_82594_a(new ResourceLocation(str2));
/*  94 */     if (soundEvent != null && (Minecraft.func_71410_x()).field_71439_g != null) {
/*  95 */       (Minecraft.func_71410_x()).field_71439_g.func_184185_a(soundEvent, f1, f2);
/*     */     }
/*  97 */     return str1;
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"停止音乐", "Sound_Stop"})
/*     */   public static void t(String a) {
/* 104 */     h(a);
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"停止全部音乐", "Sound_StopAll"})
/*     */   public static void v(vh a) {
/* 109 */     if (a == null)
/*     */       return; 
/* 111 */     for (String str : a.h) {
/* 112 */       h(str);
/*     */     }
/*     */   }
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"debug"})
/*     */   public static void v(vh a, boolean bool) {
/* 119 */     a.qa = bool;
/*     */   }
/*     */ 
/*     */   
/*     */   public static void h(String a) {
/*     */     try {
/* 125 */       SoundHandler soundHandler = Minecraft.func_71410_x().func_147118_V();
/* 126 */       SoundManager soundManager = (SoundManager)ReflectionHelper.getPrivateValue(SoundHandler.class, soundHandler, new String[] { "sndManager", "field_147694_f" });
/* 127 */       SoundSystem soundSystem = (SoundSystem)ReflectionHelper.getPrivateValue(SoundManager.class, soundManager, new String[] { "sndSystem", "field_148620_e" });
/* 128 */       soundSystem.stop(a);
/* 129 */     } catch (Exception exception) {}
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v(String a, String str1, SoundCategory soundCategory, float f1, float f2, float f3, float f4, float f5, boolean bool) {
/* 164 */     if (!vda.q) {
/*     */       return;
/*     */     }
/* 167 */     SoundHandler soundHandler = Minecraft.func_71410_x().func_147118_V();
/* 168 */     ResourceLocation resourceLocation = new ResourceLocation("dragoncore", str1);
/*     */     
/*     */     try {
/* 171 */       Minecraft.func_71410_x().func_110442_L().func_110536_a(resourceLocation);
/* 172 */     } catch (Exception exception) {
/* 173 */       resourceLocation = new ResourceLocation("dragoncore", "sounds/" + str1);
/*     */       try {
/* 175 */         Minecraft.func_71410_x().func_110442_L().func_110536_a(resourceLocation);
/* 176 */       } catch (Exception exception1) {
/* 177 */         nm.m.d("缺少音乐文件,无法播放->" + str1);
/*     */         
/*     */         return;
/*     */       } 
/*     */     } 
/* 182 */     ISound.AttenuationType attenuationType = (f3 == 0.0F && f4 == 0.0F && f5 == 0.0F) ? ISound.AttenuationType.NONE : ISound.AttenuationType.LINEAR;
/*     */     
/* 184 */     gr gr = new gr(null, resourceLocation, soundCategory, f1, f2, bool, 0, attenuationType, f3, f4, f5);
/*     */ 
/*     */ 
/*     */ 
/*     */     
/* 189 */     SoundEventAccessor soundEventAccessor = new SoundEventAccessor(resourceLocation, null);
/* 190 */     soundEventAccessor.func_188715_a((ISoundEventAccessor)new du(resourceLocation, 1.0F, 1.0F, 1, Sound.Type.FILE, false));
/* 191 */     soundHandler.field_147697_e.func_186803_a(soundEventAccessor);
/*     */ 
/*     */     
/* 194 */     gr.setKey(a);
/* 195 */     Minecraft.func_71410_x().func_147118_V().func_147682_a((ISound)gr);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"延时", "Delay"})
/*     */   public static void v(int a) {
/* 254 */     if (Minecraft.func_71410_x().func_152345_ab())
/* 255 */       return;  if (a <= 0) {
/* 256 */       a = 1;
/*     */     }
/*     */     try {
/* 259 */       Thread.sleep(a);
/* 260 */     } catch (InterruptedException interruptedException) {}
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"randomUUID"})
/*     */   public static String v() {
/* 268 */     return UUID.randomUUID().toString();
/*     */   }
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"isUUID"})
/*     */   public static boolean v(String a) {
/*     */     try {
/* 274 */       UUID.fromString(a);
/* 275 */       return true;
/* 276 */     } catch (Exception exception) {
/* 277 */       return false;
/*     */     } 
/*     */   }
/*     */   
/* 281 */   private static final Set<String> g = Sets.newHashSet((Object[])new String[] { "http", "https" });
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"打开网页", "Url"})
/*     */   public static void z(String a) {
/*     */     try {
/* 286 */       URI uRI = new URI(a);
/* 287 */       String str = uRI.getScheme();
/* 288 */       if (str == null) {
/* 289 */         throw new URISyntaxException(a, "Missing protocol");
/*     */       }
/*     */       
/* 292 */       if (!g.contains(str.toLowerCase(Locale.ROOT))) {
/* 293 */         throw new URISyntaxException(a, "Unsupported protocol: " + str.toLowerCase(Locale.ROOT));
/*     */       }
/*     */       
/* 296 */       v(uRI);
/*     */     }
/* 298 */     catch (URISyntaxException uRISyntaxException) {
/* 299 */       nm.m.t("Can't open url for {}", new Object[] { a });
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @eos/moe/dragoncore/t(v = {"清除缓存", "Clear_Cache"})
/*     */   public static void v(String a) {
/* 317 */     switch (a.toLowerCase(Locale.ROOT)) {
/*     */       case "font":
/* 319 */         mca.q.v().clear();
/*     */         break;
/*     */     } 
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\de.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */